(function () {
	var $modal = $('#pop-modal');
	 
	 getPageData({});
	 
	 function getPageData (Filter)
	 {
	 	var Filter = Filter;
	 		Filter.page = page.page;
	 		Filter.pageSize = page.pageSize;
	 	getJson(Domain+'/ec/news/doSearchNewsList.do', Filter, function (res) {
		  if(!res.success){
	
		    $('.am-modal-bd').text(res.errorMessage);
				$modal.modal();
				setTimeout(function () {
					$modal.modal('close');
				},iWiating);

		  }
		  else{

		  		console.log(res);

	  		  	page.nowPage = res.data.pageId;
      		  	page.pageCount = res.data.pageCount;
      		  
      		  if(!res.data.rows.length){
		        $('.am-pagination').remove();
		        $('#newslist').append('<div class="empty_div">'+language.noNews+'</div>');
		        return
		      }

		     $('#newslist').empty();

			 renderTmp('#newslist', 'newslisttpl',res);

			 	lazyLoad.refresh(true);

			 	$('.am-pagination').createPage({
			        current: page.page,
			        type: 1,
			        pageCount: page.pageCount,
			        center: 3,
			        showLen: 11,
		        callback: function (curidx, obj) {
		          page.page = curidx;
		          $('#newslist').empty();
		          getPageData(Filter);
		        }
		       });

		  }
		})
	 }
})();